<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/myTag.tld" prefix="page"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script type="text/javascript" src="<%=basePath %>/login/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/login/scripts/jquery.quickpaginate.js"></script>
<script type="text/javascript">
	$(function(){
		$("#dataTable tbody tr").quickpaginate({ perpage:30, pager : $("#temp") });
	});
</script>
<script type="text/javascript" src="<%=basePath %>/login/scripts/common.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath %>/login/css/style.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath %>/login/css/theme1.css" />
<style type="text/css">
#search_bar td {
	border: none;
}

#box td {
	height: 28px;
}

#search_bar {
	width: 920px;
}
</style>
<div id="wrapper" style="margin-top: 10px;">
	<div id="content">
		<div id="box">
			<div>
				<h3>
					当前位置&nbsp;:&nbsp;气象信息员管理&nbsp;>>&nbsp;信息员积分排名
			  </h3>
			</div>
			<c:if test="${admin.role==1}">
			<div id="search_bar">
				<form action="reportAction!reportList.action" method="post">
				<table width="100%" border="0" cellspacing="3" cellpadding="0">
					<tr>
						<td>
								<input type="button" value="重新计算积分排名" onclick="javascript:location.href='adminAction!countFlush.action'" />
								<input type="button" value="导出积分数据" id="btn_output" />
								<!-- loading,suc,fail -->
								<span id="loading" style="display: none;"><img src="<%=basePath%>/login/img/blue-loading.gif" height="20" width="20"/>系统正在导出,请稍后...</span>
							</td>
						</tr>
					</table>
				</form>
			</div>
			</c:if>
			<div id="search_bar">
				<form action="adminAction!linkmanCount.action" method="post">
				<table width="100%" border="0" cellspacing="3" cellpadding="0">
					<tr>
						<td>
							姓名:
							<s:textfield name="linkman.lmName" theme="simple"></s:textfield>
							<input type="submit" value="搜索" />
						</td>
					</tr>
				</table>
				</form>
			</div>
			<div style="color:red">${operationMessage }</div>
			<table border="0" cellpadding="3" cellspacing="0"
				style="width: 910px;" id="dataTable">
				<thead>
					<tr>
						<th>姓名</th>
						<th>用户名</th>
						<th>镇区</th>
						<th>电话号码</th>
						<th>上报奖励积分</th>
						<th>额外积分</th>
						<th>总积分</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${linkmanList}" var="linkman" varStatus="sta">
					
						<tr>
							<td class="a-center">${linkman.lmName }</td>
							<td class="a-center" width="150">${linkman.lmUser }</td>
							<td class="a-center" width="150">${linkman.lmDq }</td>
							<td class="a-center" width="150">${linkman.lmId }</td>
							<td class="a-center"><a href="adminAction!pointDetail.action?yjUser.username=${linkman.lmUser}&linkmanBean.lmNum=${linkman.lmNum}" target="_blank">${linkman.countPoint }</a></td>
							<td class="a-center">
								<input id="point${sta.index}" value="${linkman.changePoint}" style="width:80px;"/>
								<c:if test="${admin.role==1}">
								<input type="button" value="修改" onclick="javascript:var v=document.getElementById('point${sta.index}').value;location.href='adminAction!changePoint.action?linkman.lmNum=${linkman.lmNum}&linkman.changePoint='+v"/>
								</c:if>
							</td>
							<td class="a-center">${linkman.lastPoint}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div id="temp" style="width:910;height: 30px;padding-left:700px;"></div>
			</div>
			<br/>
			<c:if test="${admin.role==1}">
			<form action="adminAction!setLinkmanPointRemark.action" method="post">
			<p>备注：</p>
			<textarea rows="10" cols="100" name="linkmanPointRemark" >${linkmanPointRemark}</textarea>
			<input type="submit" value="保存备注"/>
			</form>
			</c:if>
			<br/>
		</div>
		
		<br />
	</div>
<script type="text/javascript">
	$(function() {
		$("#btn_output").click(function(){
			var url="adminAction!outputAllUsersExcel.action?time="+new Date().getTime();
			window.location.href=url;
			<%--$.get(url,null,function(data){
				$("#loading").show();
				if(data=="suc"){
					alert("导出成功!");
				}else{
					alert("导出失败!");
				}
				$("#loading").hide();
			});--%>
		});
	});
</script>
